//

// (  )
//

package com.tools.acceleratecore.xlib.tool.impl;

import android.content.Context;
import android.provider.Settings.System;
import com.tools.acceleratecore.xlib.XLibFactory;
import com.tools.acceleratecore.xlib.tool.intf.IDeviceSwitchTool;

public class DeviceSwitchTool implements IDeviceSwitchTool {
    private Context mContext = null;

    public DeviceSwitchTool() {
        this.mContext = XLibFactory.getApplication();
        this._init();
    }

    private void _init() {
    }

    public int getBrightnessMode() {
        try {
            return System.getInt(this.mContext.getContentResolver(), "screen_brightness_mode");
        } catch (Exception var2) {
            var2.printStackTrace();
            return 0;
        }
    }

    public void setBrightnessMode(int nBrightnessMode) {
        try {
            System.putInt(this.mContext.getContentResolver(), "screen_brightness_mode", nBrightnessMode);
        } catch (Exception var3) {
            var3.printStackTrace();
        }

    }

    public int getBacklightBrightness() {
        try {
            return System.getInt(this.mContext.getContentResolver(), "screen_brightness");
        } catch (Exception var2) {
            var2.printStackTrace();
            return 255;
        }
    }

    public void setBacklightBrightness(int nValue) {
        try {
            System.putInt(this.mContext.getContentResolver(), "screen_brightness", nValue);
        } catch (Exception var3) {
            var3.printStackTrace();
        }

    }
}
